package com.yilin.tms.core.entity.order.transit;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yilin.tms.core.commons.base.BaseNoteEntity;
import com.yilin.tms.core.commons.annotation.Explain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

/**
 * 电子回执单基于此创建
 * */
@Entity
@Table(name = "transit_order_note")
@TableName(value = "transit_order_note")
public class TransitOrderNote extends BaseNoteEntity {

    /**
     * 节点状态
     */
    public enum NoteStatus {
        waitLoading(0, "等待装货"),
        waitDeliver(1, "等待发货"),
        waitReceipt(2, "运输中，等待签收"),
        transitEnd(3, "运输结束"),
        scraped(4, "已销单");

        @EnumValue
        public Integer index;
        public String name;

        NoteStatus(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    @Explain("货源ID")
    @Column(name = "goods_order_id")
    private String goodsOrderId;
    @Explain("抢单ID")
    @Column(name = "rob_order_id")
    private String robOrderId;
    @Explain("运单ID")
    @Column(name = "transit_order_id")
    private String transitOrderId;
    @Explain("原货源节点ID")
    @Column(name = "goods_order_note_id")
    private String goodsOrderNoteId;//
    @Explain("原抢单节点ID")
    @Column(name = "rob_order_note_id")
    private String robOrderNoteId;//

    @Explain("统一计量单位")
    @Column(name = "measure_unit")
    private String measureUnit;
    @Explain("节点状态")
    @Column(name = "note_status")
    private NoteStatus noteStatus;
    @Explain("节点排序")
    @Column(name = "note_sort")
    private Integer noteSort;

    //货物分配
    @Column(name = "note_assign_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date noteAssignTime;//分配时间
    @Column(name = "note_assign_measure")
    private Double noteAssignMeasure;//分配量
    @Column(name = "note_assign_transport_cost")
    private Double noteAssignTransportCost;//按分配运输费 单价计价有效
    //货物装车
    @Column(name = "note_loading_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date   noteLoadingTime;
    @Column(name = "note_loading_measure")
    private Double noteLoadingMeasure;
    @Column(name = "note_loading_transport_cost")
    private Double noteLoadingTransportCost;
    @Explain("装货图片")
    @Column(name = "note_loading_img",columnDefinition = "TEXT")
    private String noteLoadingImg;
    //发货
    @Column(name = "note_deliver_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date noteDeliverTime;
    @Column(name = "note_deliver_measure")
    private Double noteDeliverMeasure;
    @Column(name = "note_deliver_transport_cost")
    private Double noteDeliverTransportCost;
    //签收
    @Column(name = "note_receipt_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date noteReceiptTime;
    @Column(name = "note_receipt_measure")
    private Double noteReceiptMeasure;
    @Column(name = "note_receipt_transport_cost")
    private Double noteReceiptTransportCost;
    @Explain("收货图片")
    @Column(name = "note_receipt_img",columnDefinition = "TEXT")
    private String noteReceiptImg;
    @Explain("收货签字图片")
    @Column(name = "note_receipt_sign_img",columnDefinition = "TEXT")
    private String noteReceiptSignImg;
    @Explain("递交物流公司编号")
    @Column(name = "note_logistics_code")
    private String noteLogisticsCode;// 物流公司编号
    @Explain("递交物流单号")
    @Column(name = "note_logistics_num")
    private String noteLogisticsNum; // 物流单号
    @Explain("递交物流名称")
    @Column(name = "note_logistics_name")
    private String noteLogisticsName; // 物流名称
    //赔付
    @Column(name = "note_diff_indemnity")
    private Double noteDiffIndemnity;
    @Column(name = "note_diff_indemnity_detail",columnDefinition = "TEXT")
    private String noteDiffIndemnityDetail=""; // 赔付详情，详细说明
    /**
     * 货物LIST
     * */
    @Transient
    @TableField(exist = false)
    @Explain("货物List")
    private List<TransitOrderNoteDetail> transitOrderNoteDetailList;

    public String getNoteDiffIndemnityDetail() {
        return noteDiffIndemnityDetail;
    }

    public void setNoteDiffIndemnityDetail(String noteDiffIndemnityDetail) {
        this.noteDiffIndemnityDetail = noteDiffIndemnityDetail;
    }

    public Double getNoteDiffIndemnity() {
        return noteDiffIndemnity;
    }

    public void setNoteDiffIndemnity(Double noteDiffIndemnity) {
        this.noteDiffIndemnity = noteDiffIndemnity;
    }

    public String getNoteReceiptSignImg() {
        return noteReceiptSignImg;
    }

    public void setNoteReceiptSignImg(String noteReceiptSignImg) {
        this.noteReceiptSignImg = noteReceiptSignImg;
    }

    public NoteStatus getNoteStatus() {
        return noteStatus;
    }

    public Integer getNoteSort() {
        return noteSort;
    }

    public void setNoteSort(Integer noteSort) {
        this.noteSort = noteSort;
    }

    public void setNoteStatus(NoteStatus noteStatus) {
        this.noteStatus = noteStatus;
    }

    public String getGoodsOrderId() {
        return goodsOrderId;
    }

    public void setGoodsOrderId(String goodsOrderId) {
        this.goodsOrderId = goodsOrderId;
    }

    public String getRobOrderId() {
        return robOrderId;
    }

    public void setRobOrderId(String robOrderId) {
        this.robOrderId = robOrderId;
    }

    public String getTransitOrderId() {
        return transitOrderId;
    }

    public void setTransitOrderId(String transitOrderId) {
        this.transitOrderId = transitOrderId;
    }

    public String getGoodsOrderNoteId() {
        return goodsOrderNoteId;
    }

    public void setGoodsOrderNoteId(String goodsOrderNoteId) {
        this.goodsOrderNoteId = goodsOrderNoteId;
    }

    public String getRobOrderNoteId() {
        return robOrderNoteId;
    }

    public void setRobOrderNoteId(String robOrderNoteId) {
        this.robOrderNoteId = robOrderNoteId;
    }

    public String getMeasureUnit() {
        return measureUnit;
    }

    public void setMeasureUnit(String measureUnit) {
        this.measureUnit = measureUnit;
    }

    public Date getNoteAssignTime() {
        return noteAssignTime;
    }

    public void setNoteAssignTime(Date noteAssignTime) {
        this.noteAssignTime = noteAssignTime;
    }

    public Double getNoteAssignMeasure() {
        return noteAssignMeasure;
    }

    public void setNoteAssignMeasure(Double noteAssignMeasure) {
        this.noteAssignMeasure = noteAssignMeasure;
    }

    public Double getNoteAssignTransportCost() {
        return noteAssignTransportCost;
    }

    public void setNoteAssignTransportCost(Double noteAssignTransportCost) {
        this.noteAssignTransportCost = noteAssignTransportCost;
    }

    public Date getNoteLoadingTime() {
        return noteLoadingTime;
    }

    public void setNoteLoadingTime(Date noteLoadingTime) {
        this.noteLoadingTime = noteLoadingTime;
    }

    public Double getNoteLoadingMeasure() {
        return noteLoadingMeasure;
    }

    public void setNoteLoadingMeasure(Double noteLoadingMeasure) {
        this.noteLoadingMeasure = noteLoadingMeasure;
    }

    public Double getNoteLoadingTransportCost() {
        return noteLoadingTransportCost;
    }

    public void setNoteLoadingTransportCost(Double noteLoadingTransportCost) {
        this.noteLoadingTransportCost = noteLoadingTransportCost;
    }

    public String getNoteLoadingImg() {
        return noteLoadingImg;
    }

    public void setNoteLoadingImg(String noteLoadingImg) {
        this.noteLoadingImg = noteLoadingImg;
    }

    public Date getNoteDeliverTime() {
        return noteDeliverTime;
    }

    public void setNoteDeliverTime(Date noteDeliverTime) {
        this.noteDeliverTime = noteDeliverTime;
    }

    public Double getNoteDeliverMeasure() {
        return noteDeliverMeasure;
    }

    public void setNoteDeliverMeasure(Double noteDeliverMeasure) {
        this.noteDeliverMeasure = noteDeliverMeasure;
    }

    public Double getNoteDeliverTransportCost() {
        return noteDeliverTransportCost;
    }

    public void setNoteDeliverTransportCost(Double noteDeliverTransportCost) {
        this.noteDeliverTransportCost = noteDeliverTransportCost;
    }

    public Date getNoteReceiptTime() {
        return noteReceiptTime;
    }

    public void setNoteReceiptTime(Date noteReceiptTime) {
        this.noteReceiptTime = noteReceiptTime;
    }

    public Double getNoteReceiptMeasure() {
        return noteReceiptMeasure;
    }

    public void setNoteReceiptMeasure(Double noteReceiptMeasure) {
        this.noteReceiptMeasure = noteReceiptMeasure;
    }

    public Double getNoteReceiptTransportCost() {
        return noteReceiptTransportCost;
    }

    public void setNoteReceiptTransportCost(Double noteReceiptTransportCost) {
        this.noteReceiptTransportCost = noteReceiptTransportCost;
    }

    public String getNoteReceiptImg() {
        return noteReceiptImg;
    }

    public void setNoteReceiptImg(String noteReceiptImg) {
        this.noteReceiptImg = noteReceiptImg;
    }

    public String getNoteLogisticsCode() {
        return noteLogisticsCode;
    }

    public void setNoteLogisticsCode(String noteLogisticsCode) {
        this.noteLogisticsCode = noteLogisticsCode;
    }

    public String getNoteLogisticsNum() {
        return noteLogisticsNum;
    }

    public void setNoteLogisticsNum(String noteLogisticsNum) {
        this.noteLogisticsNum = noteLogisticsNum;
    }

    public String getNoteLogisticsName() {
        return noteLogisticsName;
    }

    public void setNoteLogisticsName(String noteLogisticsName) {
        this.noteLogisticsName = noteLogisticsName;
    }

    public List<TransitOrderNoteDetail> getTransitOrderNoteDetailList() {
        return transitOrderNoteDetailList;
    }

    public void setTransitOrderNoteDetailList(List<TransitOrderNoteDetail> transitOrderNoteDetailList) {
        this.transitOrderNoteDetailList = transitOrderNoteDetailList;
    }
}
